﻿/*
 *  Copyright 2009 Coditate Software
 *  Licensed under the GNU Library General Public License (LGPL) 2.1 
 *  
 *  License available at: http://simplesavant.codeplex.com/license
 */
namespace Coditate.Savant
{
    /// <summary>
    /// Defines the dynamic SimpleSavant methods for interacting with SimpleDB.
    /// </summary>
    /// <remarks>
    /// The methods defined on this interface allow completely dynamic interactions with Savant. They are 
    /// primarily intended for use by tools and infrastructure code that cannot use the strongly typed generic
    /// methods such as <see cref="SimpleSavant.Get{T}"/>
    /// <para>
    /// See the documentation on <see cref="SimpleSavant"/> for more detailed usage instructions.
    /// </para>
    /// </remarks>
    /// <seealso cref="ItemMapping"/>
    /// <seealso cref="PropertyValues"/>
    /// <seealso cref="AttributeMapping"/>
    /// <seealso cref="SimpleSavant"/>
    /// <seealso cref="SavantConfig"/>
    /// <seealso cref="SelectCommand"/>
    /// <seealso cref="ISimpleSavant2"/>
    public interface ISimpleSavant2
    {
        /// <summary>
        /// Puts a list of item values into SimpleDB.
        /// </summary>
        void PutAttributes(ItemMapping mapping, params PropertyValues[] values);

        /// <summary>
        /// Gets an ad-hoc list of item values from SimpleDB without an item type generic parameter.
        /// </summary>
        PropertyValues GetAttributes(ItemMapping mapping, object itemName, params string[] propertyNames);

        /// <summary>
        /// Deletes an ad-hoc list of item values from SimpleDB without an item type generic parameter.
        /// </summary>
        void DeleteAttributes(ItemMapping mapping, object itemName, params string[] propertyNames);

        /// <summary>
        /// Executes the specified select command against SimpleDB
        /// using advanced options provided by the command object without an item type generic parameter.
        /// </summary>
        SelectResults<PropertyValues> SelectAttributes(SelectCommand command);

        /// <summary>
        /// Executes the specified select command against SimpleDB
        /// without an item type generic parameter and returns only the first attribute 
        /// value in the result set.
        /// </summary>
        object SelectScalar(SelectCommand command);
    }
}